package com.angel.provider.app.impl;

import java.util.Date;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.angel.core.base.BaseProviderImpl;
import com.angel.dao.health.BuzCircleMapper;
import com.angel.health.BuzCircle;
import com.angel.provider.app.BuzCircleProvider;

/** 
* @author 作者姓名  cheng
* @version 
* 创建时间：2016年9月19日 下午2:49:02 
* 类说明 
*/
@Service
public class BuzCircleProviderImpl extends BaseProviderImpl<BuzCircle> implements BuzCircleProvider{

	@Autowired
	private BuzCircleMapper mapper;
	
	//删除圈子
	public int delete(BuzCircle buzCircle) {
		List<Map<String, Object>> list = mapper.findAll(buzCircle);
		if(list != null && list.size() > 0){
			Integer id = (Integer) list.get(0).get("id");
			BuzCircle circle = mapper.selectByPrimaryKey(id);
			circle.setUpdateTime(new Date());
			circle.setEnable(0);
			return mapper.updateByPrimaryKeySelective(circle);
		}
		return 0;
	}

}
